<?

function smarty_function_form( $params ) {

	// fetch the url for the request
	$url = Smutty_Utils::getUrl(
		Smutty_Utils::strToHash($params['url'])
	);

	// work out the handler
	$update = $params['update'];
	$handler = $params['handler'];
	$feedback = $params['feedback'];
	$method = $params['method'] ? $params['method'] : 'post';

	// normal form or ajax form?
	if ( $update )
		echo '<form onsubmit="smutty_ajaxForm(this,' .
				'\'' . $url . '\',' .
				'\'' . $update . '\',' .
				'\'' . $handler . '\',' .
				'null,' .
				'\'' . $feedback . '\'' .
			');return false;">';
	else
		echo '<form method="' . $method . '" action="' . $url . '">';

}

?>